using System;
using System.Text.RegularExpressions;

namespace Servlets.Utils {
	public static class StringUtils {
		public static string RegexReplace(this string self, string regex, string replacement) {
			Regex rgx = new Regex(regex);
			return rgx.Replace(self, replacement);
		}
		
		public static bool Matches(this string self, string pattern) {
			Regex regex = new Regex(pattern);
			return regex.IsMatch(self);
		}
	}
}

